package com.pj.util;

import org.springframework.core.env.Environment;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: springboot-pure
 * @ClassName PropertyUtil
 * @description:
 * @author: gzf
 * @create: 2023-11-16 17:19
 * @Version 2.0
 **/
public class PropertyUtil {

    public static Map<String, Object> handle(String dbPrefix, Environment environment) {
        HashMap<String, Object> dataSource = new HashMap<>();
        dataSource.put("driver-class-name",environment.getProperty(dbPrefix+"."+"driver-class-name"));
        dataSource.put("url",environment.getProperty(dbPrefix+"."+"url"));
        dataSource.put("username",environment.getProperty(dbPrefix+"."+"username"));
        dataSource.put("password",environment.getProperty(dbPrefix+"."+"password"));
        return dataSource;
    }
}
